#coding=utf-8
import requests,json

url='http://172.16.91.97:8008/sit-api/new/oa_auth/login'
headers={'Content-Type':'application/json'}
data={}
data['userNumber']='20280'
data['password']='000000'
ree = requests.post(url,data=json.dumps(data),headers=headers)
re=json.loads(ree.content)
token = re['data']['token']
print (token)

url1 = "http://172.16.91.97/new/oa_wechat/enrollmentApplet/uploadFile"

file_path=u"E:\测试-简历文件\【java开发工程师_深圳】邹建华 3年.pdf"
file_path_name='邹建华'
file_path_number='15677883454'
zuopinji=r"E:\20231219-095348.png"
with open(file_path,'rb') as file:
   files = {'file': file}
   headers = {'Authorization': token}
   response = requests.post( url1, headers=headers, files=files)
   re1=json.loads(response.content)
   obsFileId = re1['data']['obsFileId']
with open(zuopinji,'rb') as file2:
   files2 = {'file': file2}
   headers = {'Authorization': token}
   response = requests.post( url1, headers=headers, files=files2)
   re2=json.loads(response.content)
   obsFileId1 = re2['data']['obsFileId']
   print(obsFileId,obsFileId1)
url2 = "http://172.16.91.97/new/oa_wechat/recruitPost/sendResumeSubmission"
data2={
       "resumeSubmitterName": "琪琪",
       "resumeSubmitterNumber": "20281",
       "recruitPostId": 5,
       "candidate": file_path_name,
       "candidatePhoneNumber": file_path_number,
       "resumeObsId": obsFileId,
       "portfolioObsId": obsFileId1,
       "claimantNumber": "cscaihw"
}
headers2 = {'Authorization': token,'Content-Type':'application/json'}
res= requests.post(url2,data=json.dumps(data2),headers=headers2)
print (res.content)


